home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FGL304C.ZIP;1 / EXC.ARJ / FGDOC / EXAMPLES / C / 09-04.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-24  |  811 b   |  37 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    int new_mode, old_mode;
  10.    int read_status, write_status;
  11.  
  12.    new_mode = fg_bestmode(320,200,1);
  13.    if (new_mode < 0 || new_mode == 12) {
  14.       printf("This program requires a 320 ");
  15.       printf("x 200 color graphics mode.\n");
  16.       exit(1);
  17.       }
  18.    old_mode = fg_getmode();
  19.    fg_setmode(new_mode);
  20.    fg_move(0,199);
  21.  
  22.    read_status = fg_showspr("CORAL.SPR",320);
  23.    fg_waitkey();
  24.    if (read_status == 0)
  25.       write_status = fg_makespr(0,319,80,99,"NEW.SPR");
  26.    else
  27.       write_status = 1;
  28.  
  29.    fg_setmode(old_mode);
  30.    fg_reset();
  31.  
  32.    if (read_status == 1)
  33.       printf("CORAL.SPR not found.\n");
  34.    if (write_status == 1)
  35.       printf("NEW.SPR not created.\n");
  36. }
  37.